/*************************************************************************
 *                                                                       *
 * This file is part of the FreeMAPs distribution.  For full copyright   *
 * information, see COPYRIGHT and COPYING.LESSER.                        *
 *                                                                       *
 * Author:           sqbang                                              *
 * Email:            sqbang@ustc.edu                                     *
 * Date:             2013.12.11                                          *
 * Acknowledgements: This file is a copy from SAMRAI projection          *
 *                   with slight modification.                           *
 *                                                                       *
 *************************************************************************/

namespace FreeMAPs
{

inline int
Parser::get_num_of_errors() const
{
    return d_errors;
}



inline int
Parser::get_num_of_warnings() const
{
    return d_warnings;
}


inline Parser*
Parser::get_instance()
{
    return s_default_parser;
}


inline InputDatabase*
Parser::get_scope()
{
    return d_scope_stack.front();
}


inline void
Parser::enter_scope(
    const std::string& name)
{
    d_scope_stack.push_front (d_scope_stack.front()->put_database(name));
}


inline void
Parser::leave_scope()
{
    d_scope_stack.pop_front();
}


inline void
Parser::set_line(
    const std::string& line)
{
    Parser::ParseData& pd = d_parse_stack.front();
    pd.d_linebuffer = line;
}


inline int
Parser::get_line_number() const
{
    return d_parse_stack.front().d_linenumber;
}

}
